{include file="public/header" /}
<body class="bgc" style="padding-top: 0">
<ul class="address-list">
    {foreach name="list" item="vo"}
    <li class="choice" data-id="{$vo.id}">
        <div class="address-only">
            <div class="flex-layout">
                <div class="left">{$vo.nickname}　{$vo.tel}
                    {if $vo.default == 1}<p>默认</p>{/if}
                </div>
            </div>
            <div>{$vo.p?$vo.p.title:''}{$vo.c?$vo.c.title:''}{$vo.d?$vo.d.title:''}{$vo.details}</div>
        </div>
    </li>
    {/foreach}
</ul>
<p class="save save-fixed">+ 添加收货地址</p>
</body>
{include file="public/footer" /}
<script>
    $(function () {
        $('.choice').click(function (e) {
            var id = $(this).attr('data-id');
            _ajax('{:url("address/choice")}', {id: id});
        });
        $(".save").click(function () {
            if (window.name != '') {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                parent.window.location.href = "{:url('address/add')}?type={$type}";
            } else {
                window.location.reload();
            }
        });
    });
</script>
</html>